<!-- 分账分拥详情（临时） -->
<template>
  <div class="app-container">
    <el-row class="header-wrap" justify="space-between" align="middle">
      <div>分账分拥详情（临时）</div>
      <el-button @click="back">返回上一页</el-button>
    </el-row>
    <el-descriptions class="descriptions" title="分账分拥详情" :column="3" border>
      <el-descriptions-item label="采购单编号">{{ tableData.purchaseOrderNo }}</el-descriptions-item>
      <el-descriptions-item label="商家名称">{{ tableData.businessName }}</el-descriptions-item>
      <el-descriptions-item label="工厂名称">{{ tableData.factoryName }}</el-descriptions-item>
      <el-descriptions-item label="代理商名称">{{ tableData.agentName }}</el-descriptions-item>
      <el-descriptions-item label="本次商家支付总金额">{{ tableData.totalMoney }}</el-descriptions-item>
      <el-descriptions-item label="本次商家支付给代理商的金额">{{ tableData.toAgentMoney }}</el-descriptions-item>
      <el-descriptions-item label="本次商家支付给工厂的金额">{{ tableData.inMoney }}</el-descriptions-item>
      <el-descriptions-item label="收款日期">{{ tableData.receiptDate }}</el-descriptions-item>
    </el-descriptions>

    <el-descriptions class="descriptions" title="分账" :column="3" border>
      <el-descriptions-item label="财务分账状态">{{
        tableData.splitStatus == 0
          ? "初始化"
          : tableData.splitStatus == 1
            ? "分账中"
            : tableData.splitStatus == 2
              ? "分账成功"
              : tableData.splitStatus == 3
                ? "部分分账成功"
                : "--"
      }}</el-descriptions-item>
      <el-descriptions-item label="工厂金额">{{ tableData.toFactoryMoneyTotal }}</el-descriptions-item>
      <el-descriptions-item label="平台金额">{{ tableData.toSaasAccountMoneyTotal }}</el-descriptions-item>
      <el-descriptions-item label="保证金金额扣除比例">{{ tableData.depositRatio }}</el-descriptions-item>
      <el-descriptions-item label="保证金金额">{{ tableData.depositAmount }}</el-descriptions-item>
      <el-descriptions-item label="工厂营销分佣扣除比例">{{ tableData.factorySalesRatio }}</el-descriptions-item>
      <el-descriptions-item label="工厂营销分佣金额">{{ tableData.factorySalesAmount }}</el-descriptions-item>
      <el-descriptions-item label="工厂集采分佣扣除比例">{{ tableData.factoryPurchaseRatio }}</el-descriptions-item>
      <el-descriptions-item label="工厂集采分佣金额">{{ tableData.factoryPurchaseAmount }}</el-descriptions-item>
    </el-descriptions>

    <el-descriptions class="descriptions" title="营销分佣" :column="3" border>
      <el-descriptions-item label="工厂开拓人员名称">{{ tableData.introducerName }}</el-descriptions-item>
      <el-descriptions-item label="工厂开拓人员分佣比例">{{ tableData.introducerRatio }}</el-descriptions-item>
      <el-descriptions-item label="工厂开拓人员分佣金额">{{ tableData.introducerAmount }}</el-descriptions-item>
      <el-descriptions-item label="渠道第一次分佣比例">{{ tableData.firstChannelRatio }}</el-descriptions-item>
      <el-descriptions-item label="渠道第一次分佣金额">{{ tableData.firstChannelAmount }}</el-descriptions-item>
      <el-descriptions-item label="展厅第一次分佣比例">{{ tableData.firstExhibitionHallRatio }}</el-descriptions-item>
      <el-descriptions-item label="展厅第一次分佣金额">{{ tableData.firstExhibitionHallAmount }}</el-descriptions-item>
      <el-descriptions-item label="营销分佣 -平台直接分佣比例">{{ tableData.firstPlatformRatio }}</el-descriptions-item>
      <el-descriptions-item label="平台在第一次分佣时获得总金额">{{ tableData.salesPlatformAmount }}</el-descriptions-item>
      <el-descriptions-item label="展厅第二次分佣比例">{{ tableData.secondExhibitionHallRatio }}</el-descriptions-item>
      <el-descriptions-item label="展厅第二次分佣金额">{{ tableData.secondExhibitionHallAmount }}</el-descriptions-item>
      <el-descriptions-item label="渠道第二次分佣比例">{{ tableData.secondChannelRatio }}</el-descriptions-item>
      <el-descriptions-item label="展厅第二次分佣金额">{{ tableData.secondChannelAmount }}</el-descriptions-item>
    </el-descriptions>

    <el-descriptions class="descriptions" title="渠道" :column="3" border>
      <el-descriptions-item label="开拓商家的渠道名称">{{ tableData.channelName }}</el-descriptions-item>
      <el-descriptions-item label="开拓商家的渠道分佣金额">{{ tableData.channelAmount }}</el-descriptions-item>
      <el-descriptions-item label="上级渠道名称">{{ tableData.parentChannelName }}</el-descriptions-item>
      <el-descriptions-item label="上级渠道分佣金额">{{ tableData.parentChannelAmount }}</el-descriptions-item>
      <el-descriptions-item label="上上级渠道名称">{{ tableData.parent2ChannelName }}</el-descriptions-item>
      <el-descriptions-item label="上上级渠道分佣金额">{{ tableData.parent2ChannelAmount }}</el-descriptions-item>
      <el-descriptions-item label="展厅名称">{{ tableData.exhibitionHallName }}</el-descriptions-item>
    </el-descriptions>
  </div>
</template>
<script setup>
import { getPage } from "@/api/system/rebateRules/paymentDistribution/details";
import { onMounted } from "vue";

const route = useRoute();
const router = useRouter();

const tableData = ref([]);
const queryData = ref({
  current: 1,
  size: 10
});
const getTable = () => {
  queryData.value.splitManageId = route.query.splitManageId;
  getPage(queryData.value).then(res => {
    tableData.value = res.data;
  });
};

// 返回上一页
const back = () => {
  router.go(-1);
};

onMounted(() => {
  getTable();
});
</script>
<style scoped lang="scss">
.header-wrap {
  border-bottom: 1px solid #e1effe;
  padding-bottom: 20px;
  margin-bottom: 20px;
}
.descriptions {
  margin-bottom: 30px;
}
</style>
